There are 2 kinds of If statements, the multi
If x is True then evaluate stamentsA.
If x is True then evaluate statementsA otherwise evaluate statementsB.
If x is True then evaluate statementsA; otherwise if y is True, evaluate statementsB; otherwise evaluate statementsC.
If x is true then do y. If x is not true (Else), do z.
The following example is applicable to Basic syntax:
If {Employee.Dept} = "Sales" Then
formula = {Employee.Salary} * 0.06
formula = {Employee.Salary} * 0.04
Assigns rate of salary increase based on an employee's department
The If part of the expression can include text, numbers, (Cust#<"10000"), and formulas ({@Formula}), where @Formula is Boolean.
For full details on how to use the If statement, see:
Single
If x is true then do y. If x is not true (Else), do z.
The following example is applicable to Crystal syntax:
If {customer.POSTAL CODE} <= "49999" Then
Assigns method of shipping based on distance from ship point.
If ToNumber ({file.ITEM}) >= 2500 and ToNumber({file.ITEM}) < 2600 Then
If statement includes an and operator for the ToNumber (numeric), ToNumber (string), ToNumber (Boolean) function.
{file.DISTRIBUTOR} * {file.COUNT}
Quantity ordered determines price list used.
Allocation based on quantity ordered using If
Prints the print date (from the PrintDate function) on the first page, and prints nothing [as designated by the empty date CDate(0,0,0)] on the remaining pages.
For full details on how to use the If statement, see:
If expressions (Crystal syntax)
More details on If expressions (Crystal syntax)
Most formula examples use this operator. Select the formula of interest from the Formulas in action index.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |